package com.pptv.schedule.strategy;

import java.util.List;
import java.util.Random;

import com.pptv.ads.core.model.Node;
import com.pptv.ads.core.strategy.NodeSelectStrategy;

public class RandomNodeSelectStrategy implements NodeSelectStrategy{

	public final static Random random = new Random(); 
	public Node select(String jobId, List<Node> nodes) {
		if(nodes == null || nodes.isEmpty()){
			return null;
		}
		return nodes.get(random.nextInt(nodes.size()));
	}
	
}
